﻿// Learn more about F# at http://fsharp.net

namespace DcsGauges.Functional.Math

module LinAlg =
    let InterpolateFromX(x : float32, x0 : float32, y0 : float32, x1 : float32, y1 : float32) = 
        let dx      = abs(x1 - x0)
        let dy      = abs(y1 - y0)
        let y       = x * (dy / dx)
        y

    let InterpolateFromY(y : float32, x0 : float32, y0 : float32, x1 : float32, y1 : float32) =
        let dx      = abs(x1 - x0)
        let dy      = abs(y1 - y0)
        let x       = y * (dx / dy)
        x;


